package com.fox.imagedb.gui;

import javax.swing.JTextPane;
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyleContext;
import javax.swing.text.StyledDocument;

public class PropertiesPane extends JTextPane {

	private static final long serialVersionUID = 4836740513953172564L;

	public static final String STYLE_REGULAR = "regular";

	public static final String STYLE_TITLE = "title";

	public static final String STYLE_BOLD = "bold";

	public static final String STYLE_ITALIC = "italic";

	public static final String STYLE_TAXON = "taxon";

	public PropertiesPane() {
		super();
		addStylesToDocument(getStyledDocument());
	}

	protected void addStylesToDocument(StyledDocument doc) {
		// Initialize some styles.
		Style def = StyleContext.getDefaultStyleContext().getStyle(
				StyleContext.DEFAULT_STYLE);

		Style regular = doc.addStyle(STYLE_REGULAR, def);
		StyleConstants.setFontFamily(def, "SansSerif");

		Style s = doc.addStyle(STYLE_ITALIC, regular);
		StyleConstants.setItalic(s, true);

		Style bold = doc.addStyle(STYLE_BOLD, regular);
		StyleConstants.setBold(bold, true);

		s = doc.addStyle(STYLE_TITLE, bold);
		StyleConstants.setUnderline(s, true);

		s = doc.addStyle(STYLE_TAXON, bold);
		StyleConstants.setItalic(s, true);

		// s = doc.addStyle("small", regular);
		// StyleConstants.setFontSize(s, 10);
		//
		// s = doc.addStyle("large", regular);
		// StyleConstants.setFontSize(s, 16);

	}

}
